import { _decorator, Button, Component, Node } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('MassageController')
export class MassageController extends Component {

    @property({type:Node,tooltip:'控制节点'})
    controlNode:Node = null;

    @property({type:Button,tooltip:'关闭按钮'})
    closeBtn:Button = null;

    onLoad(){
        this.close()
        if(this.closeBtn){
            this.closeBtn.node.on(Button.EventType.CLICK,this.close,this);
        }
      
    }

   public close(){
        if(this.controlNode){
            this.controlNode.active =false ;
        }
    }

    public show(){
        if(this.controlNode){
            this.controlNode.active = true;
        }
    }

    start() {

    }

    update(deltaTime: number) {
        
    }
}


